public class Chessman {
    private String label;
    private int x;
    private int y;
    Chessman(String label,int x,int y){
        this.label=label;
        this.x=x;
        this.y=y;
    }
    String getLabel(){
        return label;
    }
    void setLabel(String label){
        this.label=label;
    }
    int getX(){
        return x;
    }
    void setX(int x){
        this.x=x;
    }
    int getY(){
        return y;
    }
    void setY(int y){
        this.y=y;
    }
    ChessmanMemento save(){
        ChessmanMemento memento=new ChessmanMemento(label,x,y);
        return memento;
    }
    void restore(ChessmanMemento memento){
        label= memento.getLabel();
        x= memento.getX();
        y=memento.getY();
    }
    void PRI(){
        System.out.println("label:"+label);
        System.out.println("X:"+x);
        System.out.println("Y:"+y);
    }
}
